package com.bw.base.net

import com.bw.base.entity.*
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface ApiService {
    //登陆
    @POST("/api/user/login")
    suspend fun login(@Query("username") name:String,@Query("password") pass:String): Res<UserEntity>
    //注册
    @POST("/api/user/register")
    suspend fun register(@Query("username") name:String,@Query("password") pass:String): Res<RegisterEntity>
    //园区公告
    @GET("/api/announcements")
    suspend fun announcements(@Query("page") page:Int,@Query("size") size:Int): Res<GonggaoEntity>
    //根据区域车位列表
    @GET("/api/parking-spaces/area/{areaId}")
    suspend fun park(@Path("areaId") id:Int):Res<ParkEntity>
    //根据车位状态获取车位列表
    @GET("/api/parking-spaces/status/{spaceStatus}")
    suspend fun parkStatus(@Path("spaceStatus") id:String):Res<ParkEntity>
    //添加车位
    @POST("/api/parking-spaces")
    suspend fun addPark(@Body addParkData:AddParkData):Res<AddParkEntity>
}